import request from '@/utils/request'
export default {
    getImgCaptcha(uuid){
        return request({
            url:'/user/getImgCaptcha?uuid='+uuid,
            method:'get'
        })
    },
    getSmsCaptcha(phone,uuid){
        return request({
            url:'/user/getSmsCaptcha?uuid='+uuid+'&phone='+phone,
            method:'get'
        })
    },
    getImg(src){
        return request({
            url:`/getImage?filePath=${src}`,
            method:'get',
            responseType: 'arraybuffer'
        })
    },
    pwdLogin(params){
        return request({
            url:'/user/pwdLogin',
            method:'post',
            data:params
        })
    },
    smsLogin(params){
        return request({
            url:'/user/smsLogin',
            method:'post',
            data:params
        })
    },
    getLogin(){
        return request({
            url:'/user/getLogin',
            method:'get'
        })
    },
    getUserMenuList(){
        return request({
            url:'/user/getMenuList',
            method:'get',
            data: {},
        })
    },
    exitLogin(){
        return request({
            url:'/user/exitLogin',
            method:'get',
            data: {},
        })
    },
    getUserList(params){
        console.log('getUserList');
        return request({
            url:'/user/list',
            method:'post',
            data: params
        })
    },
    userDel(data){
        return request({
            url:'/user/del',
            method:'delete',
            data:data
        })
    },
    userSave(params){
        return request({
            url:'/user/save',
            method:'post',
            data: params
        })
    },
    userUpdate(params){
        return request({
            url:'/user/update',
            method:'put',
            data: params
        })
    },
    userSelect(phone){
        return request({
            url:'/user/select?phone='+phone,
            method:'get'
        })
    },
    getMenuList(params){
        return request({
            url:'/menu/list',
            method:'post',
            data: params,
            mock:true
        })
    },
    getMenuListAll(){
        return request({
            url:'/menu/selectAll',
            method:'get',
        })
    },
    menuSaveSubmit(params){
        return request({
            url:'/menu/save',
            method:'post',
            data: params
        })
    },
    menuUpdateSubmit(params){
        return request({
            url:'/menu/update',
            method:'put',
            data: params
        })
    },
    menuDelSubmit(menu_id){
        return request({
            url:'/menu/del?menu_id='+menu_id,
            method:'delete'
        })
    },
    getRoleList(params){
        return request({
            url:'/role/list',
            method:'post',
            data: params
        })
    },
    roleSave(params){
        return request({
            url:'/role/save',
            method:'post',
            data: params
        })
    },
    roleUpdate(params){
        return request({
            url:'/role/update',
            method:'put',
            data: params
        })
    },
    roleConfigMenus(params){
        return request({
            url:'/role/configMenus',
            method:'put',
            data: params
        })
    },
    roleRemove(role_id){
        return request({
            url:'/role/del?role_id='+role_id,
            method:'delete'
        })
    },
    roleListMenuId(role_id){
        return request({
            url:'/role/listMenuId?role_id='+role_id,
            method:'get'
        })
    },
    roleListAll(){
        return request({
            url:'/role/listAllSelect',
            method:'get'
        })
    },
    oplogList(params){
        return request({
            url:'/oplog/list',
            method:'post',
            data: params
        })
    },
}
